package com.kefu.notice.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.notice.model.BossNoticeInfo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "")
public class BossNoticeInfoOpenSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "标题")
    private String title;
    @ApiModelProperty(value = "内容")
    private String content;

	 @Override
    public  LambdaQueryWrapper<BossNoticeInfo> lambdaQuery(){
    	LambdaQueryWrapper<BossNoticeInfo> wrapper=Wrappers.<BossNoticeInfo>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(title), BossNoticeInfo::getTitle, title);
		wrapper.eq(BossNoticeInfo::getDataStatus, 1);
		wrapper.eq(BossNoticeInfo::getPublishStatus, 1);
	    wrapper.eq(StringUtils.isNotBlank(content), BossNoticeInfo::getContent, content);
	    wrapper.orderByAsc(BossNoticeInfo::getSortNum);
    	return wrapper;
	}
}